package com.zz.zzliving.commodity.entity;

import java.util.List;

/**
 * 实体类如果返回树形结构，则需要继承此类
 * @author 张哲
 * @email a252013135@163.com
 * @date 2024/3/26 20:03
 */
public class BaseTree {
    private Long id;
    private String name;
    private Long parentId;

    private List<BaseTree> children;

    public BaseTree() {
    }

    public BaseTree(Long id, String name, Long parentId) {
        this.id = id;
        this.name = name;
        this.parentId = parentId;
    }

    public BaseTree(Long id, String name, Long parentId, List<BaseTree> children) {
        this.id = id;
        this.name = name;
        this.parentId = parentId;
        this.children = children;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Long getParentId() {
        return parentId;
    }

    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }

    public List<BaseTree> getChildren() {
        return children;
    }

    public void setChildren(List<BaseTree> children) {
        this.children = children;
    }
}
